package genericAndInterface

import "fmt"

// 泛型的一些注意事项
func GenericNtc() {
	//type mySlice[T ~int | ~float32] []T
	//type myint int
	//type youint myint
	//_ = mySlice[myint]{1,2,3,4}
	//_ = mySlice[youint]{1,2,3,4}

	// 套用
	type myType[T int | string | float32 | float64] []T
	type floatType[P float32 | float64] myType[P]
	type myStruct[D int | string] struct {
		mySlice    myType[D]
		testInt    int
		testString string
	}

	// 语义歧义
	//type test1[P *int] []p
	type test1[P *int,] []P
	type test2[T interface{ *int | string | float32 }] []T

	fmt.Println("okokok,没有语法错误。。。。。。")
}
